# Maintainer: Andrew Sun <adsun701@gmail.com>

_gemname=ruby-dbus
_realname=${_gemname}
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.17.0
pkgrel=1
pkgdesc="Ruby module for interaction with D-Bus (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://trac.luon.net/ruby-dbus"
license=('LGPL2.1')
depends=("${MINGW_PACKAGE_PREFIX}-ruby")
source=(https://rubygems.org/downloads/${_gemname}-${pkgver}.gem)
noextract=(${_gemname}-${pkgver}.gem)
sha256sums=('7c5380a0797c6050160fd5940aba11741ac4d7050fd3ffd38be386a35643502e')

package() {
  local _gemdir="$(ruby -e'puts Gem.default_dir')"
  _gemdir="$(cygpath -u ${_gemdir})"
  
  ${MINGW_PREFIX}/bin/gem install --ignore-dependencies --no-user-install -N -i "${pkgdir}${_gemdir}" -n "${pkgdir}${MINGW_PREFIX}/bin" ${_gemname}-${pkgver}.gem
  
  rm "${pkgdir}${_gemdir}/cache/${_gemname}-${pkgver}.gem"
  
  install -D -m644 "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
